﻿// ***********************************************************************
// Assembly         : DN3P.Project
// Author           : tianteng
// Created          : 08-26-2016
//
// Last Modified By : tianteng
// Last Modified On : 08-26-2016
// ***********************************************************************
// <copyright file="SettingCmd.cs" company="北京智帆高科科技有限公司">
//     Copyright © 北京智帆高科科技有限公司2016
// </copyright>
// <summary></summary>
// ***********************************************************************

using System.Windows.Forms;
using OSS.BIM.Utility;
using ZFGK.Addins;
using ZFGK.WinForms.Forms;

namespace OSS.BIM.Commands.ToolCmds
{
    /// <summary>
    ///     Class SettingCmd.
    /// </summary>
    /// <seealso cref="ZFGK.Addins.IExtendCommand" />
    internal class AsSettingCmd : IExtendCommand
    {
        /// <summary>
        ///     Runs this instance.
        /// </summary>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public CmdResult Execute(ExtendCmdData cmdData, ref string message)
        {
            var form = cmdData.ViewForm as Form;
            //var settingForm = new AsSettingForm();
            //var settingForm = new DvPropertyGridForm("设置");
            var settingForm = new PropertyGridForm("设置");
            settingForm.PropertyGrid.SelectedObject = BmConfigUtil.BaseConfig;
            settingForm.Icon = form.Icon;
            settingForm.ShowDialog(cmdData.ViewForm as Form);
            BmConfigUtil.SaveAllConfig();

            return CmdResult.Succeed;
        }
    }
}